#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;

int main() {
    long long mod = 1000000007;
    long long target, brokenCnt;
    cin >> target >> brokenCnt;
    unordered_map<long long, int> brokenSteps;
    for (long long i = 0; i < brokenCnt; i++) {
        long long curr; cin >> curr;
        brokenSteps.insert(pair<long long, int>(curr, 1));
    }
    vector<long long> dp;
    dp.push_back(brokenSteps.find(0) == brokenSteps.end() ? 1 : 0);
    dp.push_back(brokenSteps.find(1) == brokenSteps.end() ? 1 : 0);
    while (dp.size() <= target) {
        if (brokenSteps.find(dp.size()) == brokenSteps.end()) {
            dp.push_back((dp[dp.size() - 1] + dp[dp.size() - 2]) % mod);
        }
        else {
            dp.push_back(0);
        }
    }
    cout << dp[target] % mod;
    return 0;
}